@extends('wechat.member-layout')

@section('content')
    <div class="container" id="container">
        <div class="hd">
            <h1 class="page_title">余额提现</h1>
        </div>
        <div class="bd">
            <form action="" method="post" style="margin-top:-20px;">
                {!! csrf_field() !!}
                <input type="hidden" name="openid" value="{{ $openid }}"/>
                <div class="weui_cells_title">余额信息</div>
                <div class="weui_cells">
                    <div class="weui_cell">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>当前余额</p>
                        </div>
                        <div class="weui_cell_ft">{{ $price = ($memberAccount ? $memberAccount->balance : 0) }}元</div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>提现中</p>
                        </div>
                        <div class="weui_cell_ft">{{ $memberAccount ? $memberAccount->lock_balance : 0 }}元</div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_bd weui_cell_primary" style="text-align: center;">
                            <a href="/wechat/withdraw/record"><p>收入明细</p></a>
                        </div>
                    </div>
                </div>
                <div class="weui_cells_title">提现规则</div>
                <div class="weui_cells">
                    <div class="weui_cell">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>最低提现</p>
                        </div>
                        <div class="weui_cell_ft">2元</div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>最高提现</p>
                        </div>
                        <div class="weui_cell_ft">50000元</div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_bd weui_cell_primary">
                            <p>每日限提</p>
                        </div>
                        <div class="weui_cell_ft">20次</div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_bd weui_cell_primary" style="text-align: center;">
                            <a href="/wechat/withdraw/list"><p>提现记录</p></a>
                        </div>
                    </div>
                </div>
                <div class="weui_cells_title">提现信息</div>
                <div class="weui_cells">
                    <div class="weui_cell">
                        <div class="weui_cell_hd">
                            <label class="weui_label">支付宝账号</label>
                        </div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input class="weui_input" type="text" name="alipay_account" placeholder="输错导致问题平台不负责" value="{{ $member->alipay_account }}"/>
                        </div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_hd">
                            <label class="weui_label">支付宝姓名</label>
                        </div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input class="weui_input" type="text" name="alipay_name" placeholder="可以不填" value="{{ $member->alipay_name }}"/>
                        </div>
                    </div>
                    <div class="weui_cell">
                        <div class="weui_cell_hd">
                            <label class="weui_label">提现金额</label>
                        </div>
                        <div class="weui_cell_bd weui_cell_primary">
                            <input class="weui_input" type="number" name="fee" placeholder="输入金额2 - 50000"/>
                        </div>
                    </div>
                </div>
                <div class="weui_cells_tips">系统扣除{{ \App\Models\SettingsCache::get('fee_rate') }}%手续费，请注意支付宝消息！</div>
                <div class="weui_cells_tips" style="text-align: center;"><a href="{{ \App\Models\SettingsCache::get('service_qr_url', '') }}">联系客服</a></div>
                <div class="weui_btn_area">
                    {!! csrf_field() !!}
                    <input class="weui_btn weui_btn_primary {{ $price < 2 ? 'weui_btn_disabled' : '' }}" name="submit" type="submit" value="确认" {{ $price < 2 ? 'disabled' : '' }}/>
                </div>
            </form>
        </div>
    </div>
@endsection
